<?php

namespace app\samos\controller;

use app\model\Config;

class SetjsController extends \app\BaseController
{

	public function index()
	{
		$jspath = input('get.jspath');
		$jsFile = dirname(dirname(dirname(__DIR__))) . $jspath;
		$jscode = file_get_contents($jsFile);


		$lbsdata = Config::getconfig('lbsapi');

		if (empty($lbsdata['qqak'])) {
			$lbsdata = Config::getsitesetupconfig('lbsapi');
		}

		if ($lbsdata['qqak']) {
			$jscode = str_replace('W4WBZ-TUD65-IDAIR-QPM36-HMFQ5-CGBZP', $lbsdata['qqak'],  $jscode);
		}

		echo ($jscode);
		die();
	}
}